﻿Imports System.Data.OleDb
Imports DTO

Public Class NhaXuatBanDAO

    Public Function LayDSNhaSanXuat() As List(Of NhaXuatBanDTO)
        Dim sql As String = "Select MaNhaSanXuat,TenNhaSanXuat From NHASANXUAT"
        DataProvider.OpenConnecttion()
        Dim reader As OleDbDataReader = DataProvider.ExecSelect(sql)
        Dim ds As New List(Of NhaXuatBanDTO)()
        While reader.Read
            Dim bc As New NhaXuatBanDTO()
            bc.MaNhaSanXuat = reader.GetInt32(0)
            bc.TenNhaSanXuat = reader.GetString(1)
            ds.Add(bc)
        End While
        DataProvider.CloseConnect()
        Return ds
    End Function

    Public Function Themnhasanxuat(ByVal sql As String) As Integer
        DataProvider.OpenConnecttion()
        Dim kq As Integer = DataProvider.ExecInsert(sql)
        DataProvider.CloseConnect()
        Return kq
    End Function

    Public Function CapNhatNhaXuatBan(ByVal sql As String) As Integer
        DataProvider.OpenConnecttion()
        Dim kq As Integer = DataProvider.ExecInsert(sql)
        DataProvider.CloseConnect()
        Return kq
    End Function
End Class
